﻿using System;
using System.Collections.Generic;

namespace Ayatta.Contract.Domain
{
    public class RechargePackage : BaseEntity<int>
    {
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 副标题
        /// </summary>
        public string SubTitle { get; set; }

        /// <summary>
        /// 充值类型
        /// </summary>
        public RechargeCategory Category { get; set; }

        /// <summary>
        /// 图标类名
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// 礼包图片
        /// </summary>
        public string Image { get; set; }

        /// <summary>
        /// 礼包描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 套餐金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 原始金额
        /// </summary>
        public decimal Original { get; set; }

        /// <summary>
        /// 赠送金额
        /// </summary>
        public decimal MoneyGift { get; set; }

        /// <summary>
        /// 赠送拍币
        /// </summary>
        public int CoinGift { get; set; }

        /// <summary>
        /// 赠送积分
        /// </summary>
        public int IntegralGift { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? BeginDate { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 使用次数
        /// </summary>
        public int Usage { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// 充值礼包次数限制
        /// </summary>
        public PackageLimit Limit { get; set; }

        /// <summary>
        /// 充值礼包次数限制(选择折扣限制为NTimesOnly或NTimesPerCustomer时使用)
        /// </summary>
        public int LimitTimes { get; set; }

        /// <summary>
        /// 充值包需满足条件Id集合(以","分隔)
        /// </summary>
        public string RequirementIds { get; set; }

        /// <summary>
        /// 扩展信息
        /// </summary>
        public string Extra { get; set; }

        /// <summary>
        /// 状态 False不可用 True可用
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 充值包需满足条
        /// </summary>
        public virtual IList<RechargePackageRequirement> Requirements { get; set; }

    }

    /// <summary>
    /// 充值礼包次数限制
    /// </summary>
    public enum PackageLimit : byte
    {
        /// <summary>
        /// 无限制
        /// </summary>
        Unlimited = 0,
        /// <summary>
        /// 只能使用N次
        /// </summary>
        NTimesOnly = 1,
        /// <summary>
        /// 每个用户只能使用N次
        /// </summary>
        NTimesPerCustomer = 2,
    }
}